package com.zhou.spring.cloud.balancer.config;

import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.RequestOriginParser;

import javax.servlet.http.HttpServletRequest;

public class MyRequestOriginParser implements RequestOriginParser {

    private static final String ORIGIN_HEADER_NAME = "ORIGIN_NAME";

    @Override
    public String parseOrigin(HttpServletRequest request) {
        String header = request.getHeader(ORIGIN_HEADER_NAME);
        return header;
    }
}
